xen/arm32: heap: Rework adr_l so it doesn't rely on where Xen is loaded
authorJulien Grall <jgrall@amazon.com>
Fri, 12 Aug 2022 19:24:43 +0000 (20:24 +0100)
committerJulien Grall <julien@xen.org>
Wed, 31 Aug 2022 19:16:22 +0000 (20:16 +0100)
commita571c1aab5a11a238eb190d20390435d49cdd50b
tree43397afdae45dd4821a964e86fcb999084852117
parentf93f7f70deca381e232968dc21da16522f28da6a
xen/arm32: heap: Rework adr_l so it doesn't rely on where Xen is loaded

At the moment, the macro addr_l needs to know whether the caller
is running with the MMU on. This is fine today because there are
only two possible cases:
 1) MMU off
 2) MMU on and linked to the virtual address

This is still cumbersome to use for the developer as they need
to know if the MMU is on.

Thankfully, Linux developpers came up with a great way to allow
adr_l to work within the range +/- 4GB of PC by emitting a PC-relative
reference [1].

Re-use the same approach on Arm and drop the parameter 'mmu'.

[1] 0b1674638a5c ("ARM: assembler: introduce adr_l, ldr_l and str_l macros")

Signed-off-by: Julien Grall <jgrall@amazon.com>
xen/arch/arm/arm32/head.S